﻿@model GameStepAzure.Models.Producto
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Master.cshtml";
}
<script type="text/javascript">
    function agrega() {

        if ($("#txtCantidad").val() <= 5 && $("#txtCantidad").val() > 0) {
            var href = $("#btnAdd").attr("href");
            href = href + "&cantidad=" + $("#txtCantidad").val();
            $("#btnAdd").attr("href", href);

            return true;
        } else {
            alert("Solo se permiten maximo 5 articulos");
            return false;
        }
    }
</script>
<div class="detail_box_content">
    <div class="product_data">
        <div class="product_title">
            @Model.Nombre
        </div>
        <div class="product_img">
            <img src="@Model.PathImagen" alt=""/>
        </div>
    </div>
    <div class="prod_info">
        <div class="prod_price">
            <span class="attr_name">Precio:</span>
            @if (Model.PrecioDescuento > 0)
            {
                <span class="price">$@Model.PrecioDescuento</span> <span class="reduce attr_value">$@Model.Precio</span>
            }
            else
            { 
                <span class="price attr_value">$@Model.Precio</span>
            }
        </div>
        <div class="prod_desc">
            <span class="attr_name">Descripci&oacute;n:</span> <span class="attr_value">@Model.Descripcion
            </span>
        </div>
        <div class="prod_desc">
            <span class="attr_name">G&eacute;nero:</span> <span class="attr_value">@Model.Genero
            </span>
        </div>
        <div class="prod_link">
            <div class="prod_add">
                <a id="btnAdd" onclick="return agrega();" href="@Url.Action("AgregarProducto", "Carrito", new { itemId = Model.Id, returnUrl = Request.RawUrl })" title="header=[Agregar a Carrito] body=[&nbsp;] fade=[on]">
                    <img src="/Images/GameStore/add_cart.png" alt="" />
                </a>
            </div>
            <div class="prod_cant">
                <span>Cantidad:</span>
                <br />
                <input id="txtCantidad" name="cantidad" type="text" size="2" value="1" />
            </div>
            <div class="prod_back">
                <a href="@Session["returnUrl"]" title="header=[Volver] body=[&nbsp;] fade=[on]">
                    <img src="/Images/GameStore/go_back.png" alt="" />
                </a>
            </div>
        </div>
    </div>
</div>
<div class="right_content">
    @Html.Partial("_CarritoStatusPartial")
</div>
